package com.drink.yan.web.rest;

import com.meta.act.app.service.ISysNoticeService;
import com.meta.act.entity.SysNotice;
import com.meta.framework.core.CommonRes;
import com.meta.framework.core.ResponseVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * java类简单作用描述
 *
 * @Title:
 * @Package: com.drink.yan.web.rest.app.
 * @Author: M.simple
 * @Remark: The modified content
 * @CreateDate: 2023/11/23 14:58
 * @Version: v2.0
 */
@RestController
@RequestMapping("/banner")
public class BannerRest {

    @Resource
    private ISysNoticeService noticeService;

    @ApiOperation(value = "获取轮播信息", notes = "获取轮播信息", tags = {"学生小程序"})
    @GetMapping("/list")
    public ResponseVo<List<SysNotice>> listBanner(){

        SysNotice sysNotice = new SysNotice();
        sysNotice.setNoticeType("banner");
        List<SysNotice> sysNotices = noticeService.selectNoticeList(sysNotice);

        return ResponseVo.success(sysNotices);
    }

    @ApiOperation(value = "获取1v1轮播", notes = "获取1v1轮播", tags = {"学生小程序"})
    @GetMapping("/list/1v1")
    public ResponseVo<List<SysNotice>> list1v1(){

        SysNotice sysNotice = new SysNotice();
        sysNotice.setNoticeType("1v1");
        List<SysNotice> sysNotices = noticeService.selectNoticeList(sysNotice);

        return ResponseVo.success(sysNotices);
    }
}
